#include <iostream>
#include <unistd.h>
#include <gtest/gtest.h>
#include <libgo/coroutine.h>
#include "gtest_exit.h"
using namespace std;
using namespace co;

Scheduler& sched2() {
    static Scheduler* obj = Scheduler::Create();
    return *obj;
}

TEST(MultiScheduler, test) {
    Scheduler& sched = g_Scheduler;
    int val = 0;
    go co_scheduler(sched) [&] {
        ++ val;
    };

    int nTaskCount = sched.TaskCount();
    EXPECT_EQ(nTaskCount, 1);
    WaitUntilNoTaskS(sched);
    EXPECT_EQ(val, 1);
}
